home *** CD-ROM | disk | FTP | other *** search
/ Mesolore / Mesolore - Disc 2.iso / mac / data / Selden.dir / 00001_Script_MovieScript 1 next >
Text File  |  2001-03-05  |  12KB  |  503 lines

  1. global MNDestList2
  2.  
  3. global gretracelist,preRo, preRx, preCdx, cdxDestList, cdxScroll, cdxNew, MNDestList, cdxLookupList, cdxLookupIdx
  4.  
  5. Global gShowBalloons, gShowText, gShowOrder, gIndex,glastPic,gshowSearch,gShowLeftPanel
  6.  
  7.  
  8. --- prepare, start, stop movie
  9. on tt
  10.   repeat with x = 2 to the number of members of castlib 3
  11.     delete line 1 to 2 of field member x of castlib 3
  12.   end repeat
  13. end
  14. on prepareMovie
  15.   
  16.   hidesprite [100]
  17.   hidesprite [101]
  18.   --  sprite(100).visible = 0
  19.   --  sprite(101).visible = 0
  20.   sprite(120).visible = 0
  21.   if voidp(gshowballoons) then gShowBalloons = FALSE
  22.   gShowText = FALSE
  23.   gShowSearch = FALSE
  24.   if voidp(gShowOrder) then gShowOrder = FALSE
  25.   if gShowOrder = FALSE then
  26.     repeat with x = 5 to 8
  27.       set the visible of sprite x = FALSE
  28.     end repeat
  29.     
  30.   end if
  31.   
  32.   if gRetraceList = void then set gRetraceList = ["Home*Intro"]
  33.   set the visible of sprite 54 = false
  34.   showPanel
  35.   if not gShowLeftPanel then
  36.     showLeftPanel
  37.   end if
  38.   
  39.   set the visible of sprite 61 = false
  40.   set the visible of sprite 60 = false
  41.   set gIndex = field "Index"
  42. end
  43.  
  44. on StartMovie
  45.   
  46.   --  puppetsprite 60, TRUE 
  47.   --  puppetsprite 61, TRUE 
  48.   
  49.   updatestage
  50.   
  51.   
  52.   cursor 4
  53.   set preRo = "C0"
  54.   set preRx = "C0"
  55.   set preCdx = "C0"
  56.   set cdxLookupIdx = "1"
  57.   set cdxLookupList = value (field ("LookupListTxt" && cdxLookupIdx))
  58.   set cdxNew = TRUE
  59.   set MNDestList = value(field "MNScriptTxt")
  60.   set MNDestList2 = value(field "MNScriptTxt2")
  61.   set cdxScroll = FALSE
  62.   set cdxDestList = ["1": "S1", "2": "S2", "3": "S3", "4": "S4", "5": "S5", "6": "S6", "7": "S7", "8": "S8", "9": "S9", "10": "S10", "11": "S11", "12": "S12", "13": "S13", "14": "S14", "15": "S15", "16": "S16", "17": "S17", "18": "S18", "19": "S19", "20": "S20"]  
  63.   
  64. end
  65.  
  66. on ExitMovie
  67.   
  68.   quit
  69. end
  70.  
  71.  
  72. on GenEnterCtyd
  73.   repeat with ctr = 8 to 17
  74.     if the castNum of sprite ctr <> 0 then
  75.       set the cursor of sprite ctr = 302
  76.     else
  77.       set the cursor of sprite ctr = 0
  78.     end if
  79.   end repeat
  80.   set the cursor of sprite 4 = 132 --16 = door
  81.   set the cursor of sprite 28 = 280 --16 = door
  82.   set the cursor of sprite 47 = 129  --47 = right zone
  83.   set the cursor of sprite 48 = 128  --48 = left zone
  84. end
  85.  
  86. on GenLeaveCtyd
  87.   repeat with ctr = 8 to 17
  88.     if the castNum of sprite ctr <> 0 then
  89.       set the cursor of sprite ctr = 0
  90.     end if
  91.   end repeat
  92.   set the cursor of sprite 4 = 0
  93.   set the cursor of sprite 28 = 0
  94.   set the cursor of sprite 47 = 0
  95.   set the cursor of sprite 48 = 0 
  96. end
  97.  
  98. on GenEnterCdx
  99.   if the type of sprite 48 <> 0 then set the cursor of sprite 48 = 134  --47 = right zone
  100.   if the type of sprite 47 <> 0 then set the cursor of sprite 47 = 133  --48 = left zone
  101.   --  set subtitleIdx = the last word of (the name of cast (the castNum of sprite 42))
  102.   --  if cdxLookupIdx <> subtitleIdx then
  103.   --    set cdxLookupIdx = subtitleIdx
  104.   --    set cdxLookupList = value (field ("LookupListTxt" && cdxLookupIdx))
  105.   --  end if
  106.   --  set cdxNew = FALSE
  107. end
  108.  
  109. on GenLeaveCdx
  110.   cursor 0
  111.   set the cursor of sprite 47 = 0
  112.   set the cursor of sprite 48 = 0
  113.   set cdxNew = TRUE
  114. end
  115.  
  116.  
  117. on GenMoveCdx
  118.   if the type of sprite 47 = 0 then 
  119.     set the cursor of sprite 47 = 0
  120.   else
  121.     set the cursor of sprite 47 = 133
  122.   end if
  123.   if the type of sprite 48 = 0 then
  124.     set the cursor of sprite 48 = 0
  125.   else
  126.     set the cursor of sprite 48 = 134
  127.   end if
  128.   
  129.   --  set subtitleIdx = the last word of (the name of cast (the castNum of sprite 42))
  130.   --  if cdxLookupIdx <> subtitleIdx then
  131.   --    set cdxLookupIdx = subtitleIdx
  132.   --    set cdxLookupList = value (field ("LookupListTxt" && cdxLookupIdx))
  133.   --  end if
  134. end
  135.  
  136. on GoRm rmName
  137.   if integer(char 2 of rmName) <> 2 then  
  138.     put "R" into char 1 of rmName
  139.     set preRx = the frameLabel
  140.     goto rmName
  141.   else   --door 2 = quit
  142.     ExitMovie
  143.   end if
  144. end
  145.  
  146. on GoCtydCdx dest
  147.   GenLeaveCtyd
  148.   set preCdx = the frameLabel
  149.   goto (GetAProp(cdxDestList, dest) & ",0")
  150.   cursor 0
  151.   GenEnterCdx
  152. end
  153.  
  154. on GoCdxCdx dest
  155.   goto (GetAProp(cdxDestList, dest) & ",0")
  156.   GenMoveCdx
  157. end
  158.  
  159. on JumpCodex frName, direction
  160.   set tempName = frName
  161.   delete char 1 of tempName
  162.   set curNum = item 1 of tempName
  163.   
  164.   GenMoveCdx
  165. end
  166.  
  167. on GoCdxMN action
  168.   if action <> "Nothing" then
  169.     --    set the visible of sprite 42 = FALSE
  170.     --    set the visible of sprite 43 = FALSE
  171.     updatestage
  172.     GenLeaveCdx
  173.     --    SetSearch("same", "invisible", TRUE)
  174.     if word 1 of action = "go" then ---skb
  175.       put "goto" into word 1 of action ---skb
  176.     end if ---skb
  177.     do(action)
  178.     --    set the visible of sprite 42 = TRUE
  179.     --    set the visible of sprite 43 = TRUE
  180.     --    SetSearch("on", "same", FALSE)
  181.   end if
  182. end
  183.  
  184.  
  185.  
  186. on GoMNCdx dest
  187.   if gShowOrder = FALSE then
  188.     repeat with x = 5 to 8
  189.       set the visible of sprite x = FALSE
  190.     end repeat
  191.   end if
  192.   set the visible of sprite 60 = FALSE
  193.   set the visible of sprite 61 = FALSE
  194.   
  195.   --  SetSearch("off", "visible", FALSE)
  196.   goto dest
  197.   GenEnterCdx
  198. end
  199.  
  200.  
  201.  
  202. on GoMNMN frLabel, sprNum
  203.   if the frame<1760 then
  204.     set btnList = getAProp(MNDestList, frLabel)
  205.     set btnDest = getAProp(btnList, sprNum)
  206.     if btnDest contains ",MR0" then
  207.       beep
  208.     else
  209.       goto btnDest
  210.     end if
  211.   else
  212.     if the frame>1760 then
  213.       set btnList = getAProp(MNDestList2, frLabel)
  214.       set btnDest = getAProp(btnList, sprNum)
  215.       if btnDest contains ",MR0" then
  216.         beep
  217.       else
  218.         goto btnDest
  219.       end if
  220.     end if
  221.   end if
  222. end
  223.  
  224. --on keyDown
  225. --  set the visible of sprite 42 to (not the visible of sprite 42)
  226. --  set the visible of sprite 43 to (not the visible of sprite 43)
  227. --end
  228.  
  229.  
  230. ---utilities
  231. on createCrossIndex
  232.   holder = ""
  233.   repeat with x = 760 to 1980
  234.     go frame x
  235.     set temp = the memberNUm of sprite 3
  236.     if temp <> 0 then
  237.       put the frame & "," & temp & RETURN after holder
  238.     end if
  239.   end repeat
  240.   put holder into field "crossRef"
  241. end
  242.  
  243.  
  244. on setFieldSizea
  245.   beginRecording
  246.     repeat with x = 1596 to 1596
  247.       go frame x
  248.       if the type of sprite 3 <> 0 then
  249.         
  250.         set which = the membernum of sprite 3
  251.         
  252.         --set the boxType of member which = #fixed
  253.         set the rect of member which of castlib 3 = rect(0, 0, 140, 280)
  254.         set the forecolor of member which of castlib 3 = 1
  255.         set the locv of sprite 3 = 118
  256.         set the loch of sprite 3 = 22
  257.       end if
  258.     end repeat
  259.   endRecording
  260.   beep
  261. end
  262.  
  263. on createindex
  264.   set templist = ""
  265.   put "" into field "index"
  266.   repeat with x = 470 to 1091
  267.     
  268.     if the mousedown then 
  269.       if the controldown then
  270.         put templist into field "index"
  271.         abort
  272.       else
  273.         put x
  274.       end if
  275.     end if
  276.     put indexLine( x ) into line (x - 469) of templist
  277.     
  278.   end repeat
  279.   
  280.   put templist into field "index"
  281. end
  282.  
  283. on indexLine which
  284.   set which="%"&which
  285.   set temp = field "balloons1"
  286.   if temp contains which then
  287.     set howMany = the number of lines in temp
  288.     repeat with x = 1 to howMany
  289.       if line x of temp contains which then
  290.         return "1,"&x
  291.         exit repeat
  292.       end if
  293.     end repeat
  294.   else
  295.     set temp = field "balloons2"
  296.     if not(temp contains which) then 
  297.       beep
  298.       put which
  299.     end if
  300.     set howMany = the number of lines in temp
  301.     repeat with x = 1 to howMany
  302.       if line x of temp contains which then
  303.         return "2,"&x
  304.         exit repeat
  305.       end if
  306.     end repeat
  307.     if x > howmany then
  308.       put which && "xx"
  309.     end if
  310.   end if
  311. end
  312.  
  313.  
  314.  
  315.  
  316. on setTextRow
  317.   set x = value(char 2 to 3 of the framelabel)
  318.   set whLine = value(line (x) of field "textWindowlist")
  319.   tell window "selden text" to set where = getAt(charPosToLoc(member "info", whLine),2)  - the lineheight of  member "info"
  320.   tell window "selden text" to  sendSprite(16,#CustomScrollbar_SetScroll,where)
  321. end
  322.  
  323. ---Leftlabs panel
  324.  
  325. on showleftPanel
  326.   if sprite(90).locH > 0 then
  327.     gShowLeftPanel=false
  328.     hideSprite [56,90,91,92,93,94,115]
  329.     repeat with x = 95 to 99
  330.       set the visible of sprite x = FALSE
  331.     end repeat
  332.   else
  333.     gShowLeftPanel=TRUE
  334.     showSprite [56,90,91,92,93,94,115]
  335.     repeat with x = 95 to 99
  336.       set the visible of sprite x = TRUE
  337.     end repeat
  338.   end if
  339.   unroll 56
  340.   updatestage
  341. end
  342.  
  343. on checkRollLeft
  344.   
  345.   if gshowBalloons then 
  346.     set the member of sprite(92) = "showballoons_x"
  347.   else
  348.     set the member of sprite(92) = "showballoons_n"
  349.   end if
  350.   if gShowText then 
  351.     set the member of sprite(94) = "ShowText_x"
  352.   else
  353.     set the member of sprite(94) = "ShowText_n"
  354.   end if
  355.   if gShowOrder then 
  356.     set the member of sprite(93) = "ShowOrder_x"
  357.   else
  358.     set the member of sprite(93) = "ShowOrder_n"
  359.   end if
  360.   repeat with x = 91 to 94
  361.     if rollover(x) then
  362.       roll x
  363.     else
  364.       unroll x
  365.     end if
  366.   end repeat
  367.   go the frame
  368. end
  369.  
  370. --- right labs panel
  371.  
  372.  
  373.  
  374. on checkRollPanel()
  375.   checkRollLeft
  376.   rolled = FALSE
  377.   repeat with x in [102,103,104,105,106,107,108,109]
  378.     if rollover(x) then
  379.       roll x
  380.       rolled = TRUE
  381.     else
  382.       unroll x
  383.     end if
  384.   end repeat
  385.   return rolled
  386. end
  387.  
  388. on showPanel
  389.   if sprite(103).locH > 0 then
  390.     hideSprite [103,104,105,106,107,108,109]
  391.   else
  392.     showSprite [103,104,105,106,107,108,109]
  393.   end if
  394. end
  395.  
  396. on showToolsMenu
  397.   if sprite(110).locH > 0 then
  398.     hideSprite [110,111,112,113]
  399.   else
  400.     showSprite [110,111,112,113]
  401.   end if
  402. end
  403.  
  404. on showSprite which
  405.   repeat with x in which
  406.     if sprite(x).locH < 0 then
  407.       sprite(x).locH = sprite(x).locH +1000
  408.     end if
  409.   end repeat
  410.   updatestage
  411. end
  412.  
  413. on hideSprite which
  414.   repeat with x in which
  415.     if sprite(x).locH > 0 then
  416.       sprite(x).locH = sprite(x).locH -1000
  417.     end if
  418.   end repeat
  419.   updatestage
  420. end
  421.  
  422. on setcursor a,b
  423.   if the machinetype = 256 then
  424.     cursor [value(a),value(a)+1]
  425.   else
  426.     cursor b
  427.   end if
  428. end
  429.  
  430. --- labs balloons, text, order
  431. on showBalloons
  432.   set glastPic = ""
  433.   set gShowBalloons= not gShowBalloons
  434.   set the visible of sprite 60=FALSE
  435.   set the visible of sprite 61=FALSE
  436.   updatestage
  437. end 
  438.  
  439. on showSearch
  440.   set gshowSearch= not gshowSearch
  441.   if gshowSearch = TRUE then 
  442.     open window "Selden Search"
  443.     set the windowtype of window "Selden Search" = 4
  444.   else
  445.     close window "Selden Search"
  446.   end if
  447. end
  448.  
  449. on SearchLocate which
  450.   put which
  451.   set the itemdelimiter = ","
  452.   temp = field "crossRef"
  453.   set hMany = the number of lines in temp
  454.   repeat with x = 1 to hMany
  455.     if item 2 of line x of temp = which then
  456.        sprite(60).visible = false
  457.       sprite(61).visible = false
  458.       goto item 1 of line x of temp
  459.       exit repeat
  460.     end if
  461.   end repeat
  462.   
  463. end
  464.  
  465. on showText
  466.   set gshowText= not gshowText
  467.   if gshowText = TRUE then 
  468.     open window "Selden Text"
  469.     set the windowtype of window "Selden Text" = 4
  470.   else
  471.     close window "Selden Text"
  472.   end if
  473.   
  474. end 
  475.  
  476. on showOrder
  477.   set gShowOrder = not gShowOrder
  478.   if the movie contains "selden" then
  479.     a = 5
  480.     b = 8
  481.   else
  482.     a =4
  483.     b=7
  484.   end if
  485.   if gShowOrder = TRUE then 
  486.     repeat with x = a to b
  487.       set the visible of sprite x = TRUE
  488.     end repeat
  489.   else
  490.     repeat with x = a to b
  491.       set the visible of sprite x = FALSE
  492.     end repeat
  493.   end if
  494.   updatestage
  495. end 
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.